#!/bin/bash
# See CONTRIBUTING.md for usage.

set -ex

TAG="docker-compose:$(git rev-parse --short HEAD)"

# By default use the Dockerfile, but can be overriden to use an alternative file
# e.g DOCKERFILE=Dockerfile.armhf script/test/default
DOCKERFILE="${DOCKERFILE:-Dockerfile}"

rm -rf coverage-html
# Create the host directory so it's owned by $USER
mkdir -p coverage-html

docker build -f ${DOCKERFILE} -t "$TAG" .

GIT_VOLUME="--volume=$(pwd)/.git:/code/.git"
. script/test/all
